'use strict';

const express = require('express');
const router = express.Router();

const auth = require('./auth');
const start = function(req, res, next) {
    console.log("request start:" + req.path);
    next();
};

const end = function(req, res) {
    console.log("request end:" + req.path);
    res.end(JSON.stringify({ error: "api is not found!", "api": req.path, "status": "error" }));
};

router.all("*", start);
router.get('/login', require('./login'));

router.all("*", auth);

router.get('/home', require('./home/home'));
router.get('/follower', require('./follower/follower').main);
router.get('/follower/list', require('./follower/follower').list);

router.all("*", end);

module.exports = router;